package uk.org.fuzelogik.eldaw.auth;

/**
 * An authentication strategy that uses locally-available means of
 * authenticating a user. The authentication process simply accepts a username
 * and password and returns a value indicating whether they're a valid pair.
 * 
 * @author cgdavies
 */
public interface ILocalAuthenticationStrategy extends IAuthenticationStrategy
{
	/**
	 * Performs an authentication check. Note that this <em>does not</em>
	 * update the user's "sign in" status.
	 * 
	 * @param username the username
	 * @param password the password
	 * @return <code>true</code> if the username and password pair is valid
	 */
	public boolean authenticate( String username, String password );

	/**
	 * Actually signs in a user by firstly authenticating them, then setting the
	 * appropriate flag.
	 * 
	 * @param username the username
	 * @param password the password
	 * @return <code>true</code> if authentication succeeded and the user was
	 * subsequently signed up
	 */
	public boolean signIn( String username, String password );
}
